package com.tsingteng.cosfun.ui.found;

import android.util.Log;

import com.tsingteng.cosfun.bean.MessageReportBean;
import com.tsingteng.cosfun.bean.VideoSignBean;
import com.tsingteng.cosfun.callback.RxObserver;
import com.tsingteng.cosfun.mvp.presenter.BasePresenter;

import java.util.List;

public class SunPresenter extends BasePresenter<SunContact.ISunView> implements SunContact.ISunPresenter{
    SunModel sunModel;
    SunContact.ISunView iSunView;
    public SunPresenter(){
        this.sunModel = new SunModel();
    }
    @Override
    public void pull(long activityId, String baskContent, String imgList) {
        iSunView = getView();
        RxObserver<MessageReportBean> rxObserver =new RxObserver<MessageReportBean>(this) {
            @Override
            protected void onFaile(int errorCode, String errorMsg) {
                iSunView.showFail(errorMsg);
            }

            @Override
            protected void onSuccess(MessageReportBean messageReportBean) {
                  iSunView.showSun();
            }
        };
        sunModel.writeSun(activityId,baskContent,imgList,rxObserver);
        addDisposable(rxObserver);
    }
    @Override
    public void loginUploadSeven() {
        iSunView = getView();
        RxObserver<VideoSignBean> rxObserver = new RxObserver<VideoSignBean>(this) {
            @Override
            protected void onFaile(int errorCode, String errorMsg) {
                Log.e("娘们",errorMsg);
            }

            @Override
            protected void onSuccess(VideoSignBean s) {
                iSunView.showUploadSeven(s);
            }
        };
        sunModel.getUploadSeven(rxObserver);
        addDisposable(rxObserver);
    }
}
